var updateUserOrgAccount={
    updateUserOrgAccountInit:function () {
        $.ajax({
            url:application.contextPath+"/user/queryUserOrgAccountByOrgIdAndParentId",
            dataType:"json",
            type:"POST",
            data:{
                "orgId":orgId,
                "parentId":parentId
            },
            success:function (res) {
                var data=res.data;
                $("#lessonAccount").val(data.lessonAccount);
            }
        });
        $("#cancel").click(function(){
            loadUtil = new Load($);
            loadUtil.load({
                container:'#homeContent',
                url: application.contextPath+"/user/showUpdateUserPage?userId="+userId+"&type="+type
            });
            return false;
        });
    },
    commitUpdate:function (form) {
        var data = {};
        var lessonAccount = $("#lessonAccount").val();
        data.orgId=orgId;
        data.parentId=parentId;
        data.lessonAccount= lessonAccount;
        $.ajax({
            url: application.contextPath+"/user/updateUserOrgAccountLessonAccount",
            type:"POST",
            contentType: "application/json; charset=utf-8",
            dataType:"json",
            data:JSON.stringify({parmsMap:data}),
            success:function (res) {
                if(res.isSuccess){
                    layer.msg('修改成功', {
                        icon: 1, title: '修改提示', btn: ['是'], yes() {
                            layer.close(layer.index);
                            loadUtil = new Load($);
                            loadUtil.load({
                                container: '#homeContent',
                                url: application.contextPath + "/user/showUpdateUserPage?userId="+userId+"&type="+type
                            });
                        }
                    });
                }else {
                    layer.open({
                        title:"加载失败!",
                        content:'页面加载失败!'
                    });
                }
            }
        });
        return false;
    }
};


$(document).ready(function(){
    updateUserOrgAccount.updateUserOrgAccountInit();
});